repo: Allow loading files staged in the transaction
authorAlexander Larsson <alexl@redhat.com>
Wed, 20 Apr 2016 13:33:44 +0000 (15:33 +0200)
committerColin Walters (automation) <walters+githubbot@verbum.org>
Thu, 21 Apr 2016 19:05:06 +0000 (19:05 +0000)
Currently we can load metadata from the stage dir, but not file
data, which makes no sense.

Closes: #269
Approved by: cgwalters

src/libostree/ostree-repo.c

index f5c1b00ace4933375598c29e0260a707169bd7d6..3c37d3421dfe48642c55d56cdbe16c4421f1c92a 100644 (file)
@@ -3066,6 +3066,13 @@ ostree_repo_load_file (OstreeRepo         *self,
                                     error))
         goto out;
 
+      if (fd < 0 && self->commit_stagedir_fd != -1)
+        {
+          if (!ot_openat_ignore_enoent (self->commit_stagedir_fd, loose_path_buf, &fd,
+                                        error))
+            goto out;
+        }
+
       if (fd != -1)
         {
           tmp_stream = g_unix_input_stream_new (fd, TRUE);